package p270jp.pxv.android.legacy.fragment;

import android.app.Dialog;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;
import android.widget.EditText;
import androidx.appcompat.app.AlertController;
import androidx.appcompat.app.AlertDialog;
import kotlin.NoWhenBranchMatchedException;
import p014ae.DialogInterface$OnClickListenerC0191y5;
import p089d.C2419a;
import p216hn.DefaultConstructorMarker;
import p270jp.pxv.android.R;
import p288ki.ViewExtension;
import p325m0.MutabilityOwnership;
import p447qi.Hilt_PasswordInputFragment;
import p603wm.Tuples;

/* compiled from: PasswordInputFragment.kt */
/* renamed from: jp.pxv.android.legacy.fragment.PasswordInputFragment */
/* loaded from: classes2.dex */
public final class PasswordInputFragment extends Hilt_PasswordInputFragment {

    /* renamed from: f */
    public static final /* synthetic */ int f19067f;

    /* compiled from: PasswordInputFragment.kt */
    /* renamed from: jp.pxv.android.legacy.fragment.PasswordInputFragment$InputType */
    /* loaded from: classes2.dex */
    public static abstract class InputType implements Parcelable {

        /* compiled from: PasswordInputFragment.kt */
        /* renamed from: jp.pxv.android.legacy.fragment.PasswordInputFragment$InputType$CurrentPassword */
        /* loaded from: classes2.dex */
        public static final class CurrentPassword extends InputType {

            /* renamed from: a */
            public static final CurrentPassword f19068a = new CurrentPassword();
            public static final Parcelable.Creator<CurrentPassword> CREATOR = new C4251a();

            /* compiled from: PasswordInputFragment.kt */
            /* renamed from: jp.pxv.android.legacy.fragment.PasswordInputFragment$InputType$CurrentPassword$a */
            /* loaded from: classes2.dex */
            public static final class C4251a implements Parcelable.Creator<CurrentPassword> {
                @Override // android.os.Parcelable.Creator
                public CurrentPassword createFromParcel(Parcel parcel) {
                    MutabilityOwnership.m3745m(parcel, "parcel");
                    parcel.readInt();
                    return CurrentPassword.f19068a;
                }

                @Override // android.os.Parcelable.Creator
                public CurrentPassword[] newArray(int i) {
                    return new CurrentPassword[i];
                }
            }

            public CurrentPassword() {
                super(null);
            }

            @Override // android.os.Parcelable
            public int describeContents() {
                return 0;
            }

            @Override // android.os.Parcelable
            public void writeToParcel(Parcel parcel, int i) {
                MutabilityOwnership.m3745m(parcel, "out");
                parcel.writeInt(1);
            }
        }

        /* compiled from: PasswordInputFragment.kt */
        /* renamed from: jp.pxv.android.legacy.fragment.PasswordInputFragment$InputType$NewPassword */
        /* loaded from: classes2.dex */
        public static final class NewPassword extends InputType {

            /* renamed from: a */
            public static final NewPassword f19069a = new NewPassword();
            public static final Parcelable.Creator<NewPassword> CREATOR = new C4252a();

            /* compiled from: PasswordInputFragment.kt */
            /* renamed from: jp.pxv.android.legacy.fragment.PasswordInputFragment$InputType$NewPassword$a */
            /* loaded from: classes2.dex */
            public static final class C4252a implements Parcelable.Creator<NewPassword> {
                @Override // android.os.Parcelable.Creator
                public NewPassword createFromParcel(Parcel parcel) {
                    MutabilityOwnership.m3745m(parcel, "parcel");
                    parcel.readInt();
                    return NewPassword.f19069a;
                }

                @Override // android.os.Parcelable.Creator
                public NewPassword[] newArray(int i) {
                    return new NewPassword[i];
                }
            }

            public NewPassword() {
                super(null);
            }

            @Override // android.os.Parcelable
            public int describeContents() {
                return 0;
            }

            @Override // android.os.Parcelable
            public void writeToParcel(Parcel parcel, int i) {
                MutabilityOwnership.m3745m(parcel, "out");
                parcel.writeInt(1);
            }
        }

        public InputType() {
        }

        public InputType(DefaultConstructorMarker eVar) {
        }
    }

    /* renamed from: f */
    public static final PasswordInputFragment m4605f(InputType inputType) {
        PasswordInputFragment passwordInputFragment = new PasswordInputFragment();
        passwordInputFragment.setArguments(C2419a.m7858f(new Tuples("argument_key_input_type", inputType)));
        return passwordInputFragment;
    }

    @Override // androidx.fragment.app.DialogFragment
    public Dialog onCreateDialog(Bundle bundle) {
        int i;
        int i2;
        int i3;
        Parcelable parcelable = requireArguments().getParcelable("argument_key_input_type");
        if (parcelable != null) {
            InputType inputType = (InputType) parcelable;
            if (MutabilityOwnership.m3749h(inputType, InputType.CurrentPassword.f19068a)) {
                i3 = R.string.settings_current_password_title;
                i2 = R.string.settings_current_password_description;
                i = R.string.settings_current_password;
            } else if (MutabilityOwnership.m3749h(inputType, InputType.NewPassword.f19069a)) {
                i3 = R.string.settings_new_password_title;
                i2 = R.string.settings_new_password_description;
                i = R.string.settings_new_password;
            } else {
                throw new NoWhenBranchMatchedException();
            }
            AlertDialog.C0305a aVar = new AlertDialog.C0305a(requireContext());
            AlertController.C0299b bVar = aVar.f1085a;
            bVar.f1070t = null;
            bVar.f1069s = R.layout.view_dialog_edittext;
            aVar.m12006h(i3);
            aVar.m12012b(i2);
            aVar.m12008f(R.string.common_ok, new DialogInterface$OnClickListenerC0191y5(this, inputType, 2));
            if (inputType instanceof InputType.NewPassword) {
                aVar.m12011c(R.string.common_cancel, null);
            }
            AlertDialog i4 = aVar.m12005i();
            EditText editText = (EditText) i4.findViewById(R.id.password_edit_text);
            if (editText != null) {
                editText.setHint(i);
            }
            return i4;
        }
        throw new IllegalArgumentException("Required value was null.".toString());
    }

    @Override // androidx.fragment.app.Fragment
    public void onResume() {
        super.onResume();
        View findViewById = requireDialog().findViewById(R.id.password_edit_text);
        MutabilityOwnership.m3746l(findViewById, "requireDialog().findView…(R.id.password_edit_text)");
        ViewExtension.m4074b(findViewById);
    }
}
